//
//  ViewController.m
//  10506简单加法计算器
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *num1;
@property (weak, nonatomic) IBOutlet UITextField *num2;
@property (weak, nonatomic) IBOutlet UILabel *sum;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)add:(id)sender
{
   int value = [self.num1.text intValue] +[self.num2.text intValue];
    self.sum.text = [NSString stringWithFormat:@"%i",value];
}
- (IBAction)backgroundtag:(id)sender {
    [self.num1 resignFirstResponder];
    [self.num2 resignFirstResponder];
}

@end
